﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cmsservice.Entity;

namespace cmsservice.DAL
{
    public class QQNoticeNGTDal
    {
        public int AddQQNoticeNGT(QQNoticeNGT qQNoticeNGT)
        {
            try
            {
                Tools tools = new Tools();

                tools.AddSqlParameter("MobileCodeBinary", System.Data.SqlDbType.VarBinary, 50, qQNoticeNGT.MobileCodeBinary);
                tools.AddSqlParameter("MobileCodeShow", System.Data.SqlDbType.VarChar, 20, qQNoticeNGT.MobileCodeShow);
                tools.AddSqlParameter("UserID", System.Data.SqlDbType.VarChar, 20, qQNoticeNGT.UserID);
                tools.AddSqlParameter("BuyTime", System.Data.SqlDbType.DateTime, qQNoticeNGT.BuyTime);
                tools.AddSqlParameter("BeginTime", System.Data.SqlDbType.DateTime, qQNoticeNGT.BeginTime);
                tools.AddSqlParameter("ExpireTime", System.Data.SqlDbType.DateTime, qQNoticeNGT.ExpireTime);

                string sql = "INSERT INTO QQNoticeNGT(MobileCodeBinary,MobileCodeShow,UserID,BuyTime,BeginTime,ExpireTime) VALUES(@MobileCodeBinary,@MobileCodeShow,@UserID,@BuyTime,@BeginTime,@ExpireTime)";

                return SqlHelper.ExecuteNonQuery(DBConn.TemporaryDB, System.Data.CommandType.Text, sql, tools.GetSqlParameters());
            }
            catch (Exception ex)
            {
                return 0;
            }
        }
    }
}
